import request from '@/utils/request.js'
const PATH = '/admin/testExamTopic'

// 获取考试题目列表
export function getTestExamTopicList({
  page,
  pageSize,
  testExamId,
  topicName
}) {
  return request.get(PATH + '/page', {
    params: {
      page,
      pageSize,
      testExamId,
      topicName
    }
  })
}

// 新增考试题目
export const insertTestExamTopic = (data) =>
  request.post(PATH + '/insert', data)

// 批量删除考试题目
export const batchDeleteTestExamTopic = (ids) =>
  request.delete(PATH + '/batchDelete', { params: { ids: ids.join(',') } })

// 根据考试题目id获取考试题目信息
export const getTestExamTopicById = ({ id, testExamId }) => {
  return request.get(PATH + '/getTestExamTopicById', {
    params: { id, testExamId }
  })
}

// 修改考试题目
export const updateTestExamTopic = (data) => request.put(PATH + '/update', data)
